package com.ykz2015.chapter3.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.boot.context.properties.ConfigurationPropertiesBean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE) //u1==u2返回false
//@Scope(value = ConfigurableBeanFactory.SCOPE_SINGLETON) //u1==u2返回true
@Component
public class User {
    @Value("250")
    private Long id;
    @Value("二百五十")
    private String userName;
    @Value("不要起外号")
    private String note;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getNote() {
        return note;
    }


    @Value("this is my note")
    public void setNote(String note) {
        this.note = note;
    }
}
